import React from 'react'
import { withRouter } from 'react-router-dom'
import './style.css'

class Title extends React.Component {
    goBack = () => {
        const { history } = this.props
        history.go(-1)
    }
    render() {
        const { title } = this.props
        return (
            <div className='title'>
                <i 
                    onClick={this.goBack} 
                    className='iconfont icon-fangxiang-xiangzuo'
                />
                { title }
            </div>
        )
    }
}

export default withRouter(Title)
